<template>
    <div>
        <input type="text" v-model="fristval"><br>
        <input type="text" v-model="lastval">
    </div>
</template>

<script setup>
import { ref, computed } from 'vue';

const props = defineProps(['frist', 'last'])

const emits = defineEmits(['update:frist', 'updade:last'])

const text = ref('a')

// const fristval = computed(() => {
//     return emits('update:frist', props.frist)
// })

// const lastval = computed(() => {
//     return emits('update:last', props.last)
// })


const fristval = computed({
  get: () => props.frist,
  set(val) {
    // 触发事件
    emits('update:frist', val)
  }
})
const lastval = computed({
  get: () => props.last,
  set(val) {
    // 触发事件
    emits('update:last', val)
  }
})

</script>

<style lang="scss" scoped>

</style>